/*
 * Copyright (c) 2020 Nanjing Xiaoxiongpai Intelligent Technology Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __WIFI_H__
    #define __WIFI_H__

    #include <stdio.h>
    #include <string.h>
    #include <unistd.h>
    #include <stdbool.h>

    #include "lwip/netif.h"
    #include "lwip/netifapi.h"
    #include "lwip/ip4_addr.h"
    #include "lwip/api_shell.h"

    #include "cmsis_os2.h"
    #include "hos_types.h"
    #include "wifi_device.h"
    #include "wifiiot_errno.h"
    #include "ohos_init.h"

    #define SELECT_WLAN_PORT "wlan0"
    #define SELECT_WIFI_SSID "xingjian"
    #define SELECT_WIFI_PASSWORD "123456789gbx"

    void WiFi_Init(void);
    bool WiFi_Connect(void);
    void WiFi_WaitSacnResult(void);
    bool WiFi_WaitConnectResult(void);
    void WiFi_OnWifiScanStateChangedHandler(int state, int size);
    void WiFi_OnWifiConnectionChangedHandler(int state, WifiLinkedInfo *info);
    void WiFi_OnHotspotStaJoinHandler(StationInfo *info);
    void WiFi_OnHotspotStateChangedHandler(int state);
    void WiFi_OnHotspotStaLeaveHandler(StationInfo *info);
#endif /* __WIFI_H__ */
